<?php
session_start();
if (!isset($_SESSION)) die("\$_SESSION not set.");
if(!is_array($_SESSION)) die("\$_SESSION not an array.");
if(!$_SESSION['login']) die("login not set.");
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $_SESSION['login']; ?></title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
<?php
echo $_SESSION['login'];
?>
</div>
<?php
require_once "lib/standard.php";
Globals::init();
mysqli_set_charset(Globals::$db, "utf8");
$query = "SELECT `id` , `login` , `onoma` , `energos` , `sira` FROM `komotis`
	 WHERE `energos` = 1 ORDER BY `sira` ASC";
$result = mysqli_query(Globals::$db, $query);
$sira = 0;
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
	
		echo "<div>" . 
			$row['id'] . " , " .
			$row['login'] . " , " .
			$row['onoma'] . " , " .
			$row['energos'] . " , " .
			$row['sira'] . " . " .
			"</div>";
}
echo "\n";
mysqli_free_result($result);


?>
</body>
</html>